﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;

namespace Anata.Client
{
    /// <summary>
    /// This class simply converts a Boolean to a Visibility
    /// with an optional invert
    /// </summary>
    [ValueConversion(typeof(int), typeof(String))]
    public class StatusTransaksiLayananToString : IValueConverter
    {

        #region IValueConverter implementation
        /// <summary>
        /// Converts Boolean to Visibility
        /// </summary>
        public object Convert(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            int status = (int)value;
            String retval = "";
            switch (status)
            {
                case 0:
                    retval = "UKNW";
                    break;
                case 1:
                    retval = "CRE";
                    break;
                case 2:
                    retval = "WAIT";
                    break;
                case 3:
                    retval = "BUSY";
                    break;
                case 4:
                    retval = "FIN";
                    break;
                case 99:
                    retval = "CANC";
                    break;
                default:
                    break;
            }
            return retval;
        }

        /// <summary>
        /// Convert back, but its not implemented
        /// </summary>
        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            throw new NotImplementedException("Not implemented");
        }
        #endregion
    }
}
